Packet transmission method and user equipment

ABSTRACT

The present invention discloses a packet transmission method and user equipment. The method includes: transmitting, by a sending node, multiple packets to a receiving node; receiving multiple acknowledgement packets from the receiving node; after determining, based on the received multiple acknowledgement packets, that a first packet is lost, retransmitting the first packet; and if it is detected that the retransmitted packet is lost, continuously retransmitting, by the sending node, the first packet to the receiving node in a preset time interval for at least twice. According to the solutions of the present invention, the retransmitted packet can be detected and recovered in time after the retransmitted packet is lost, thereby reducing a quantity of times of timeout retransmission, improving a transmission rate, moreover, reducing a packet loss probability of a retransmitted packet, and further reducing a probability of timeout retransmission.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.15/926,174, filed on Mar. 20, 2018, which is a continuation ofInternational Application No. PCT/CN2016/099480, filed on Sep. 20, 2016,which claims priority to Chinese Patent Application No. 201510605226.9,filed on Sep. 21, 2015. All of the afore-mentioned patent applicationsare hereby incorporated by reference in their entireties.

TECHNICAL FIELD

The present invention relates to the field of communicationstechnologies, and in particular, to a packet transmission method anduser equipment.

BACKGROUND

In computer network communication, a packet loss recovery algorithmplays a very significant role. The packet loss recovery algorithm is animportant algorithm that ensures reliability of data transmission in atransmission control protocol (TCP) stack, is an error tolerancemechanism when a data packet is lost, and directly affects datatransmission efficiency and utilization of a network bandwidth. RFC2581defines and describes a typical packet loss recovery algorithm, mainlyincluding timeout retransmission and fast retransmission. Timeoutretransmission is an important mechanism for ensuring data reliabilityin the TCP protocol. A principle of timeout retransmission is: A sendingnode enables a timeout timer after sending a packet, and after thetimeout timer expires, if the sending node still does not receive anacknowledgement packet (ACK for short) indicating that the packet hasbeen correctly received, the sending node resends the packet. There-sent packet is also generally referred to as a retransmitted packet.Fast retransmission is an optimized mechanism of timeout retransmission.If a transmit end receives more than N (generally, N is equal to 3)repeated ACKs, it is determined that a packet is lost, and the lostpacket is retransmitted immediately. In the fast retransmissionmechanism, packet retransmission can be performed before aretransmission timer expires, thereby greatly improving the datatransmission efficiency.

Avoiding unnecessary timeout retransmission in TCP transmission isalways a research hotspot in the academic circles and the industrialcircles. However, in most of current TCP protocol stacks, there is nomechanism for detecting loss of a retransmitted packet. If aretransmitted packet is lost, timeout retransmission occurs inevitably,and consequently, the transmission efficiency of a TCP connection isgreatly reduced.

Currently, algorithms related to loss detection and recovery of aretransmitted packet mainly include a duplicate acknowledgement counting(DAC) algorithm and a selective acknowledgment plus (SACK+) algorithm.Both the DAC algorithm and the SACK+ algorithm are asymmetric TCPacceleration algorithms, and need to be deployed only at a transmit end,and basic ideas of them are very similar.

A main principle of the DAC algorithm is as follows: When a packet isretransmitted, the transmit end estimates a quantity n of packetscurrently transmitted in a network, and counts a quantity of repeatedACKs received after packet retransmission, where a packet that isalready sent, that is not acknowledged by a receive end, and that is notdetermined by the transmit end as a lost packet is defined as a packetthat is being transmitted in a network; and if a cumulativeacknowledgment is not updated after more than n ACKs are received,determines that a currently retransmitted packet is lost, andimmediately retransmits the packet again without waiting for timeoutretransmission.

As shown in FIG. 1, it is assumed that in a send window, a packet whosesequence number is 3 is lost. As shown in step 101 in FIG. 1, afterreceiving three repeated ACKs, a transmit end starts fast retransmissionto retransmit the packet whose sequence number is 3, and estimates, byusing the DAC algorithm, a quantity of packets that are beingtransmitted in the network. A feasible estimation method is as follows(it should be noted that an estimation method is not limited to thisestimation method): The transmit end learns that a largest sequencenumber of sent packets is 8, a sequence number of a received cumulativeacknowledgment is 2, and three repeated acknowledgements are received,the transmit end determines that one packet is lost, and estimates thata quantity of packets that are being transmitted in the network is equalto 8−2−3−1=2. Then, as shown in step 102 in FIG. 1, the transmit endcounts received repeated ACKs after retransmission. When the transmitend receives the third repeated ACK after retransmission, if thesequence number of the cumulative acknowledgment is still 2 and is notupdated, the transmit end determines that the retransmitted packet islost. Finally, as shown in step 103 in FIG. 1, the transmit endimmediately retransmits the packet whose sequence number is 3 and doesnot need to wait for timeout of the retransmission timer, therebyavoiding entering timeout retransmission.

A principle of the SACK+ algorithm is similar to that of the DACalgorithm. A main difference is that in the SACK+ algorithm, it isdetermined, by using selection acknowledgement information carried in aSACK option in an acknowledgement packet, whether a retransmitted packetis lost.

However, it is found through testing that regardless of the DACalgorithm or the SACK+ algorithm, a probability that loss of aretransmitted packet cannot be detected in time is large. As a result,the retransmitted packet cannot be detected and recovered by thetransmit end in time after being lost. Consequently, timeoutretransmission is triggered. In a scenario of a high packet loss rate,frequent timeout retransmission causes an increase in a transmissiondelay and a sharp decrease in a transmission rate.

SUMMARY

Embodiments of the present invention provide a packet transmissionmethod, a sending apparatus, and a communications system, to reduce aprobability of timeout retransmission of a packet, reduce a packettransmission delay, and improve a packet transmission rate.

To achieve the foregoing objectives of the present invention, accordingto a first aspect, an embodiment of the present invention provides apacket transmission method, where the method includes: transmitting, bya sending node, multiple packets to a receiving node by using acommunications link between the sending node and the receiving node;after determining that a first packet in the multiple packets is lost,retransmitting, by the sending node, the first packet; and afterdetermining, based on an acknowledgement packet received after the firstpacket is retransmitted, that the retransmitted packet is lost,retransmitting the first packet again, and sending the first packet forat least once in a first time interval after retransmitting the firstpacket again.

In a first possible implementation manner of the first aspect, themethod further includes: receiving one or more acknowledgement packetsfrom the receiving node, and determining, according to an ack field oran extension field carried in the one or more acknowledgement packets,that the first packet is lost.

With reference to the first aspect or the first possible implementationmanner of the first aspect, in a second possible implementation manner,the method further includes: sending, by the sending node, a secondpacket in the first time interval, where the second packet is a packetthat is not sent by the sending node.

According to a second aspect, an embodiment of the present inventionprovides a packet transmission method, including: transmitting, by asending node, multiple packets to a receiving node by using acommunications link between the sending node and the receiving node;after determining that a first packet in the multiple packets is lost,retransmitting, by the sending node, the first packet; afterdetermining, based on an acknowledgement packet received after the firstpacket is retransmitted, that the retransmitted packet is lost,retransmitting the first packet again, and determining whether a sendingbuffer is empty; and if the sending buffer is not empty, sending, by thesending node, at least one packet in the sending buffer in a first timeinterval after retransmitting the first packet again, where the packetin the sending buffer is a packet that is not sent by the sending node.

In a first possible implementation manner of the second aspect, themethod further includes: if the sending buffer is empty, sending, by thesending node, the first packet in the first time interval for at leastonce.

With reference to the second aspect or the first possible implementationmanner of the second aspect, in a second possible implementation manner,the determining, by the sending node based on an acknowledgement packetreceived after the first packet is retransmitted, that the retransmittedpacket is lost includes: determining, by the sending node according toan ack field or an extension field carried in the acknowledgement packetreceived after the first packet is retransmitted, that a retransmittedpacket is lost, where the retransmitted packet is the retransmittedfirst packet.

According to a third aspect, an embodiment of the present inventionprovides a packet transmission method, including: transmitting, by asending node, multiple packets to a receiving node by using acommunications link between the sending node and the receiving node;after determining that a first packet in the multiple packets is lost,retransmitting, by the sending node, the first packet; afterdetermining, based on an acknowledgement packet received after the firstpacket is retransmitted, that the retransmitted packet is lost,retransmitting, by the sending node, the first packet again, anddetermining whether a sending buffer is empty, or whether a currentcongestion control policy allows sending of a new packet; and if thesending buffer is empty, or the current congestion control policy doesnot allow sending of the new packet, sending, by the sending node, thefirst packet for at least once in a first time interval afterretransmitting the first packet again.

In a first possible implementation manner of the third aspect, themethod further includes: if the sending buffer is not empty, and thecurrent congestion control policy allows sending of the new packet,sending, by the sending node, at least one packet in the sending bufferin the first time interval.

In any one of the foregoing aspects or any one of the possibleimplementation manners of any one of the foregoing aspects, the firsttime interval is greater than or equal to 0, and is less than a periodof a timeout timer of the first packet; and the sending node has notreceived, in the first time interval, an acknowledgement packet used toindicate that the first packet retransmitted again is lost.

In any one of the foregoing aspects or any one of the possibleimplementation manners of any one of the foregoing aspects, thecommunications link between the sending node and the receiving node is aTCP connection.

In any one of the foregoing aspects or any one of the possibleimplementation manners of any one of the foregoing aspects, the packetin the sending buffer is a packet that is not sent by the sending node.

With reference to any one of the foregoing aspects or any one of thepossible implementation manners of any one of the foregoing aspects, thesending node retransmits the lost first packet in a preset time intervalafter the sending node detects that the retransmitted packet is lost,where the preset time interval uses a moment at which the sending nodedetects that the retransmitted first packet is lost as a start point,and the preset time interval is greater than or equal to 0, and is lessthan a period of a timeout timer of the first packet; or the preset timeinterval approaches 0.

According to a fourth aspect, an embodiment of the present inventionprovides user equipment, including: a wireless modem, a processor, anantenna, and a TCP protocol stack, where the wireless modem is connectedto the antenna; the TCP protocol stack is configured to: encapsulate,under the control of the processor, data of an application programrunning on the user equipment into multiple packets, and send themultiple packets to the wireless modem; the wireless modem is configuredto: modulate the received packets to analog signals, and send the analogsignals to a server by using the antenna; and the TCP protocol stack isfurther configured to: upon determination that a first packet in themultiple packets is lost, retransmit the first packet to the server byusing the wireless modem and the antenna, and after determining, basedon an acknowledgement packet received after the first packet isretransmitted, that the retransmitted packet is lost, retransmit thefirst packet again, and send the first packet to the server for at leastonce in a first time interval after retransmitting the first packetagain.

In a first possible implementation manner of the fourth aspect, the TCPprotocol stack is further configured to send a second packet in thefirst time interval by using the wireless modem and the antenna, wherethe second packet is a packet that is not sent by the user equipment.

According to a fifth aspect, an embodiment of the present inventionprovides user equipment, including: a wireless modem, a processor, anantenna, and a TCP protocol stack, where the wireless modem is connectedto the antenna; the TCP protocol stack is configured to: encapsulate,under the control of the processor, data of an application programrunning on the user equipment into multiple packets, and send themultiple packets to the wireless modem; the wireless modem is configuredto: modulate the received packets to analog signals, and send the analogsignals to a server by using the antenna; and the TCP protocol stack isfurther configured to: upon determination that a first packet in themultiple packets is lost, retransmit the first packet to the server byusing the wireless modem and the antenna, and determine, based on anacknowledgement packet received after the first packet is retransmitted,that the retransmitted packet is lost; retransmit the first packet tothe server again, and determine whether a sending buffer is empty; andif the sending buffer is not empty, send at least one packet in thesending buffer to the server in a first time interval afterretransmitting the first packet again.

In a first possible implementation manner of the fifth aspect, the TCPprotocol stack is further configured to: if the sending buffer is empty,send the first packet to the server in the first time interval for atleast once by using the wireless modem and the antenna.

With reference to the fifth aspect or the first possible implementationmanner of the fifth aspect, in a second possible implementation manner,the TCP protocol stack is specifically configured to determine,according to an ack field or an extension field carried in theacknowledgement packet received after the first packet is retransmitted,that the retransmitted packet is lost.

According to a sixth aspect, an embodiment of the present inventionprovides user equipment, including: a wireless modem, a processor, anantenna, and a TCP protocol stack, where the wireless modem is connectedto the antenna; the TCP protocol stack is configured to: encapsulate,under the control of the processor, data of an application programrunning on the user equipment into multiple packets, and send themultiple packets to the wireless modem; the wireless modem is configuredto: modulate the received packets to analog signals, and send the analogsignals to a server by using the antenna; and the TCP protocol stack isfurther configured to: upon determination that a first packet in themultiple packets is lost, retransmit the first packet to the server byusing the wireless modem and the antenna, and determine, based on anacknowledgement packet received after the first packet is retransmitted,that the retransmitted packet is lost; retransmit the first packet tothe server again, and determine whether a sending buffer is empty, orwhether a current congestion control policy allows sending of a newpacket; and if the sending buffer is empty, or the current congestioncontrol policy does not allow sending of the new packet, send the firstpacket to the server for at least once in a first time interval afterretransmitting the first packet again.

In a first possible implementation manner of the sixth aspect, the TCPprotocol stack is further configured to: if the sending buffer is notempty, and the current congestion control policy allows sending of thenew packet, send at least one packet in the sending buffer to the serverin the first time interval by using the wireless modem and the antenna.

In the fourth to the sixth aspects or any one of the possibleimplementation manners of the fourth to the sixth aspects, the firsttime interval is greater than or equal to 0, and is less than a periodof a timeout timer of the first packet; and the user equipment has notreceived, in the first time interval, an acknowledgement packet used toindicate that the first packet retransmitted again is lost.

In the fourth to the sixth aspects or any one of the possibleimplementation manners of the fourth to the sixth aspects, the packet inthe sending buffer is a packet that is not sent by the user equipment;and the retransmitted packet is the first packet retransmitted by theuser equipment the first time when the user equipment detects that thefirst packet is lost.

In the fourth to the sixth aspects or any one of the possibleimplementation manners of the fourth to the sixth aspects, the TCPprotocol stack is specifically configured to retransmit the first packetto the server by using the wireless modem and the antenna in a presettime interval upon determination that the first packet in the multiplepackets is lost, where the preset time interval is greater than or equalto 0, and is less than a period of a timeout timer of the first packet;or the preset time interval approaches 0.

According to a seventh aspect, an embodiment of the present inventionprovides user equipment, including: a sending unit, configured to sendmultiple packets to a receiving node in communication connection withthe user equipment; a receiving unit, configured to receive multipleacknowledgement packets from the receiving node; and a processing unit,configured to: determine, according to the multiple acknowledgementpackets received by the receiving unit, that a first packet in themultiple packets is lost; trigger the sending unit to retransmit thefirst packet to the receiving node; and determine, according to anacknowledgement packet received by the receiving unit after the firstpacket is retransmitted, that the retransmitted packet is lost, wherethe sending unit is further configured to: after the processing unitdetermines that the retransmitted packet is lost, continuously send thefirst packet in a first time interval for at least twice.

In a first possible implementation manner of the seventh aspect, thesending unit is further configured to send a second packet in the firsttime interval, where the second packet is a packet that is not sent bythe sending unit.

According to an eighth aspect, an embodiment of the present inventionprovides user equipment, including: a sending unit, configured to sendmultiple packets to a receiving node in communication connection withthe user equipment; a receiving unit, configured to receive multipleacknowledgement packets from the receiving node; and a processing unit,configured to: determine, according to the multiple acknowledgementpackets received by the receiving unit, that a first packet in themultiple packets is lost; trigger the sending unit to retransmit thefirst packet to the receiving node; and determine, according to anacknowledgement packet received by the receiving unit after the firstpacket is retransmitted, that the retransmitted packet is lost, wherethe sending unit is further configured to: after the processing unitdetermines that the retransmitted packet is lost, retransmit the firstpacket again, and determine whether a sending buffer is empty; and ifthe sending buffer is not empty, send at least one packet in the sendingbuffer in a first time interval after retransmitting the first packetagain.

In a first possible implementation manner of the eighth aspect, thesending unit is further configured to: if the sending buffer is empty,send the first packet in the first time interval for at least once.

According to a ninth aspect, an embodiment of the present inventionprovides user equipment, including: a sending unit, configured to sendmultiple packets to a receiving node in communication connection withthe user equipment; a receiving unit, configured to receive multipleacknowledgement packets from the receiving node; and a processing unit,configured to: determine, according to the multiple acknowledgementpackets received by the receiving unit, that a first packet in themultiple packets is lost; trigger the sending unit to retransmit thefirst packet to the receiving node; and determine, according to anacknowledgement packet received by the receiving unit after the firstpacket is retransmitted, that the retransmitted packet is lost, wherethe sending unit is further configured to: after the processing unitdetermines that the retransmitted packet is lost, retransmit the firstpacket again, and determine whether a sending buffer is empty, orwhether a current congestion control policy allows sending of a newpacket; and if the sending buffer is empty, or the current congestioncontrol policy does not allow sending of the new packet, send the firstpacket for at least once in a first time interval after retransmittingthe first packet again.

In a first possible implementation manner of the ninth aspect, thesending unit is further configured to: if the sending buffer is notempty, and the current congestion control policy allows sending of thenew packet, send at least one packet in the sending buffer in the firsttime interval, where the packet in the sending buffer is a packet thatis not sent by the sending unit.

In the eighth and the ninth aspects or any one of the possibleimplementation manners of the eighth and the ninth aspects, the sendingunit is specifically configured to: after the processing unit determinesthat the retransmitted packet is lost, retransmit the first packet in apreset time interval again, where the preset time interval is greaterthan or equal to 0, and is less than a period of a timeout timer of thefirst packet; or the preset time interval approaches 0.

In the seventh to the ninth aspects or any one of the possibleimplementation manners of the seventh to the ninth aspects, the firsttime interval is greater than or equal to 0, and is less than a periodof a timeout timer of the first packet; and the receiving unit has notreceived, in the first time interval, an acknowledgement packet used toindicate that the first packet retransmitted again is lost.

In the seventh to the ninth aspects or any one of the possibleimplementation manners of the seventh to the ninth aspects, the packetin the sending buffer is a packet that is not sent by the sending node.

In the seventh to the ninth aspects or any one of the possibleimplementation manners of the seventh to the ninth aspects, the sendingunit is configured to retransmit the lost first packet in a preset timeinterval after it is detected that the retransmitted packet is lost,where the preset time interval is greater than or equal to 0, and isless than a period of a timeout timer of the first packet; or the presettime interval approaches 0.

According to a tenth aspect, an embodiment of the present inventionprovides a packet transmission method, including: transmitting, by asending node, multiple packets to a receiving node by using acommunications link between the sending node and the receiving node;receiving multiple acknowledgement packets from the receiving node;determining, based on the received multiple acknowledgement packets,that a first packet in the multiple packets is lost; and retransmittingthe first packet to the receiving node, and sending the first packet ina second time interval for at least once, where the second time intervalis greater than or equal to 0, and is less than a period of a timeouttimer of the first packet; and the sending node has not received, in thesecond time interval, an acknowledgement packet used to indicate thatthe retransmitted first packet is lost.

According to an eleventh aspect, an embodiment of the present inventionprovides a packet transmission method, including: transmitting, by asending node, multiple packets to a receiving node by using acommunications link between the sending node and the receiving node;receiving multiple acknowledgement packets from the receiving node;determining, based on the received multiple acknowledgement packets,that a first packet in the multiple packets is lost; retransmitting thefirst packet to the receiving node, and determining whether a sendingbuffer is empty; and if the sending buffer is not empty, sending, by thesending node, at least one packet in the sending buffer in a second timeinterval, where the packet in the sending buffer is a packet that is notsent by the sending node, the second time interval is greater than orequal to 0, and is less than a period of a timeout timer of the firstpacket, and the sending node has not received, in the second timeinterval, an acknowledgement packet used to indicate that theretransmitted first packet is lost.

In a first possible implementation manner of the eleventh aspect, if thesending buffer is empty, the sending node sends the first packet in thesecond time interval for at least once.

According to a twelfth aspect, an embodiment of the present inventionprovides a packet transmission method, including: transmitting, by asending node, multiple packets to a receiving node by using acommunications link between the sending node and the receiving node;receiving multiple acknowledgement packets from the receiving node;determining, based on the received multiple acknowledgement packets,that a first packet in the multiple packets is lost; retransmitting, bythe sending node, the first packet to the receiving node, anddetermining whether a sending buffer is empty, or whether a currentcongestion control policy allows sending of a new packet; and if thesending buffer is empty, or the current congestion control policy doesnot allow sending of the new packet, sending, by the sending node, thefirst packet in a second time interval for at least once.

In the tenth to the twelfth aspects or any one of the possibleimplementation manners of the tenth to the twelfth aspects, the secondtime interval uses a moment of retransmitting the first packet again asa start point, and uses a moment of receiving the first acknowledgementpacket after the first packet is retransmitted again as an end point.

In the tenth to the twelfth aspects or any one of the possibleimplementation manners of the tenth to the twelfth aspects, the secondtime interval is greater than or equal to 0, and is less than a periodof a timeout timer of the first packet, and the sending node has notreceived, in the second time interval, an acknowledgement packet used toindicate that the retransmitted first packet is lost.

In the tenth to the twelfth aspects or any one of the possibleimplementation manners of the tenth to the twelfth aspects, afterdetermining that the first packet in the multiple packets is lost, thesending node retransmits the first packet in a preset time intervalagain, where the preset time interval is greater than or equal to 0, andis less than a period of a timeout timer of the first packet; or thepreset time interval approaches 0.

An embodiment of the present invention further provides user equipment,where the user equipment includes a function unit configured toimplement the method in the tenth to the twelfth aspects or any one ofthe possible implementation manners of the tenth to the twelfth aspects.

An embodiment of the present invention further provides a computerreadable storage medium, where the storage medium stores program code,and the program code is used to perform steps of the method described inany one of the foregoing aspects or the possible implementation mannersof any one of the foregoing aspects.

According to the packet transmission method and the user equipment thatare provided in the embodiments of the present invention, after it isdetected that a packet is lost, the lost packet is rapidly andredundantly sent for multiple times, or a new packet is immediately sentafter the lost packet is retransmitted, so that the sending node canreceive acknowledgement packets as continuously as possible afterretransmitting the lost packet, and triggers a packet loss detection andrecovery algorithm of the retransmitted packet in time according to theacknowledgement packets, so that the retransmitted packet can bedetected and recovered in time after being lost, thereby reducing aquantity of times of timeout retransmission, and improving atransmission rate. In addition, if the retransmitted packet is lostagain, timeout retransmission may be triggered. However, if theretransmitted packet is fast retransmitted for multiple times in a shorttime, a probability that the retransmitted packet is lost isexponentially reduced, thereby further reducing a probability of timeoutretransmission.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of the presentinvention or in the prior art more clearly, the following brieflydescribes the accompanying drawings required for describing theembodiments or the prior art.

FIG. 1 is a schematic diagram of a packet loss recovery algorithm in theprior art;

FIG. 2 is a schematic diagram of a communications system according to anembodiment of the present invention;

FIG. 3 is a schematic diagram of a TCP packet format;

FIG. 4 is a diagram of a principle of a fast retransmission method inthe prior art;

FIG. 5 is a schematic diagram of a packet transmission method accordingto an embodiment of the present invention;

FIG. 6 is a schematic diagram of another packet transmission methodaccording to an embodiment of the present invention;

FIG. 7 is a schematic diagram of another packet transmission methodaccording to an embodiment of the present invention;

FIG. 8 is a schematic diagram of an application scenario of embodimentsof the present invention;

FIG. 9 is a schematic diagram of another packet transmission methodaccording to an embodiment of the present invention;

FIG. 10 is a diagram of a working principle of a TCP protocol stackaccording to an embodiment of the present invention;

FIG. 11 is a schematic diagram of user equipment according to anembodiment of the present invention;

FIG. 12 is a schematic diagram of user equipment according to anembodiment of the present invention; and

FIG. 13 is a schematic diagram of user equipment according to anembodiment of the present invention.

DESCRIPTION OF EMBODIMENTS

To make a person skilled in the art understand the technical solutionsin the present invention better, the following clearly describes thetechnical solutions in the embodiments of the present invention withreference to the accompanying drawings in the embodiments of the presentinvention. Apparently, the described embodiments are merely a partrather than all of the embodiments of the present invention.

The technical solutions provided in the embodiments of the presentinvention may be typically applied to a communications system having arelatively high packet loss rate, for example, a global system formobile communications (GSM) network, a code division multiple access(CDMA) network, a wideband code division multiple access (WCDMA)network, a general packet radio service (GPRS) network, a long termevolution (LTE) network, a software defined network (SDN), and awireless sensor network (WSN).

FIG. 2 is a simplified block diagram of a communications system 100according to an embodiment of the present invention. The communicationssystem 100 is merely used as an application scenario of the presentinvention, and should not be understood as a limitation to theapplication scenario of the present invention. It may be understood thatthe technical solutions provided in this embodiment of the presentinvention are applicable to any communications system that is based on aTCP/IP protocol stack. It should be noted that the TCP/IP protocol stackis a protocol stack implemented with reference to a division manner fora protocol level defined by a TCP/IP reference model. The TCP/IPprotocol stack includes two core protocols: the transmission controlprotocol (TCP) and the Internet protocol (IP). In this embodiment of thepresent invention, implementation of the TCP protocol is optimized. Itmay be understood that the method of this embodiment of the presentinvention is also applicable to another reliable transmission protocolhaving a packet retransmission mechanism.

In the specification, claims, and accompanying drawings of the presentinvention, the terms “first”, “second”, “third”, “fourth”, and so on (ifexistent) are intended to distinguish between similar objects but do notnecessarily indicate a specific order or sequence.

The communications system 100 includes: user equipment 110, an accesspoint 10, a wireless access gateway 12, a wide area network 14, a firstapplication server 20, a second application server 30, and a thirdapplication server 40. A person skilled in the art may understand thatone communications system may generally include fewer or more componentsthan components shown in FIG. 2, or include a component different fromthe components shown in FIG. 2. FIG. 2 merely shows the components morerelated to multiple implementation manners disclosed in this embodimentof the present invention.

For example, although three application servers 20, 30, and 40 arealready described in FIG. 2, a person skilled in the art may understandthat one communications system may include any quantity of applicationservers, or even does not include any application server. Theapplication servers 20, 30, and 40 respectively include correspondingTCP protocol stacks 21, 31, and 41. Functions of the TCP protocol stacks21, 31, and 41 may be respectively executed by proper combinations ofsoftware, hardware, and/or firmware running on the application servers20, 30, and 40. The wide area network 14 may include: some of and/or anycombination of a public network, a private network, and the Internet.The wireless access gateway 12 and the access point 10 may be includedin one wireless network. For simplicity, another part of the wirelessnetwork is not described. The access point 10 further includes anantenna 11.

The user equipment 110 includes: a processor 120, a TCP protocol stack130, a wireless modem 140, and a memory 150. The wireless modem 140 maybe connected to an antenna 142. A person skilled in the art mayunderstand that the TCP protocol stack 130 may be executed by a propercombination of software, hardware, and/or firmware. The TCP protocolstack 130, the wireless modem 140, and the antenna 142 cooperate witheach other to complete transmission and reception of a packet under thecontrol of the processor. In addition, a person skilled in the art mayunderstand that user equipment may include fewer or more components thanthe components shown in FIG. 2. The user equipment 110 shown in FIG. 2merely shows the components more related to multiple implementationmanners disclosed in this embodiment of the present invention.

Generally, the memory 150 of the user equipment 110 stores applicationprograms, for example, a first application program 121, a secondapplication program 123, and a third application program 125. The firstapplication program 121, the second application program 123, and thethird application program 125 are respectively application programs onclient sides of the first application program server 20, the secondapplication program server 30, and the third application program server40. The processor 120 may read and execute the application programs inthe memory 150, to implement particular functions.

The TCP protocol stack uses a client-server communication model. Theclient requests and accepts a service provided by the server, forexample, web page content. For example, the first application program121 may be a web page browser requesting information from the firstapplication program server 20.

The user equipment 110 in this embodiment of the present invention maybe a mobile terminal, for example, a portable, wearable, or vehicularmobile device such as a mobile phone, an action camera, or a notebookcomputer, or may be a device such as a computer or a server, or may be anetwork device such as a router or a gateway. The user equipment 110 mayestablish a TCP connection to another user equipment, and furtherreceive and transmit a packet by using the TCP connection. A format of aTCP packet is shown in FIG. 3. A source port and a destination port areconfigured to determine application processes of a transmit end and areceive end. A source port number, a destination port number, a sourceIP address, and a destination IP address may uniquely determine a TCPconnection. A sequence number (generally seq for short) of a header of aTCP packet carries a sequence number of the first data byte in a payloadof the packet. After receiving the TCP packet, a receiving node sends anacknowledgement packet (ACK) to a sending node by using a TCPconnection. A field value of an acknowledge number (generally ack forshort) of a header of the ACK packet represents a value of a “SequenceNumber” field of a packet received by the receiving node, and alsorepresents that the receive end has received all packets that are sentby the transmit end and whose values of “Sequence Numbers” are less thanthat of the “Acknowledge Number” of the ACK packet. A size of a windowis used to indicate a size of a current receiving buffer area of thereceive end. In addition, the header of the TCP packet further has sixflag bits:

URG: urgent pointer field significant;

ACK: acknowledge number field significant;

PSH: immediate transmission to an application layer for processing;

RST: resetting when an abnormality occurs;

SYN: a synchronization flag, which is set to 1 upon connectionestablishment; and

FIN: a termination flag, requesting to release a connection.

The user equipment 110 may establish a TCP connection to the applicationprogram server 20 or another user equipment by using a wired network ora wireless network (for example, a Wi-Fi network, a WSN, or a cellularnetwork). Establishment of the TCP connection to the application programserver 20 may be initiated by a software application program (forexample, a browser or the first application program 121 in FIG. 1).Specifically, the user equipment 110 and the application program server20 may establish a TCP connection by using a three-way handshake. Forexample, the first application program 121 generates a socket open(socket open) command. The command is provided to a TCP protocol stack120 of the user equipment 110, to trigger a TCP protocol stack 130 toestablish a TCP connection to the application program server 20 by usingthree message exchanges. Then, the TCP protocol stack 130 notifies theupper-layer first application program 121 that the connection has beenestablished. The TCP protocol stack of the application program server 20also notifies an upper-layer application process that the connection hasbeen established. Subsequently, the first application program 121 andthe application program server 20 on the user equipment 110 may performdata transmission based on the established TCP connection. A personskilled in the art may understand that the user equipment 110 and theaccess point 10 access a radio service channel by using thecorresponding antenna 142 and antenna 11.

A TCP packet loss detection mechanism and a fast retransmissionmechanism in the prior art are described below by using a specificinstance. To simplify the description, in some embodiments of thepresent invention, one of two devices that have established a connectionbetween each other is referred to as a sending node, and the other isreferred to as a receiving node. It may be understood that the sendingnode and the receiving node may be any devices having data transmissionand reception capabilities, for example, the foregoing user equipment orthe foregoing application program server. As shown in FIG. 4, it isassumed that the sending node sends five packets whose sequence numbersare 1, 2, 3, 4, and 5. The packet whose sequence number is 1 (brieflyreferred to as packet 1) is the first received by the receiving node,and the receiving node returns an acknowledgement packet ACK1 whoseacknowledge number ack=1. If packet 2 does not arrive at the receivingnode for a reason, while the packet 3 arrives at the receiving node, thereceiving node still returns ACK1. If packets 4 and 5 arrive at thereceiving node, the receiving node still returns ACK1, because packet 2does not arrive at the receiving node yet. Therefore, the sending nodereceives three acknowledgement packets whose acks are equal to 1, anddetermines that packet 2 is lost. Therefore, the sending node does notneed to wait until a retransmission timer expires, and immediatelyretransmits the packet whose sequence number is 2 again. Then, thereceiving node receives packet 2. In this case, because packets 3, 4,and 5 are already received, the receiving node returns anacknowledgement packet ACKS whose acknowledge number is ack=5.

Timeout retransmission of a TCP packet is an important reason for lowutilization of a network bandwidth and an increased transmission delay.An existing fast retransmission mechanism reduces a probability oftimeout retransmission to some degree. However, if a retransmittedpacket is lost again, and is not detected and recovered in time, timeoutretransmission inevitably occurs. Although in the prior art, packet lossdetection and recovery can be performed for a retransmitted packet byusing, for example, DAC and SACK+ algorithms, it is found, throughrepeated tests and experiments, that after a packet loss detection andrecovery algorithm of a retransmitted packet is introduced, a throughputis not obviously improved. It is found that a main reason for thisresult is that the existing retransmission packet loss detection andrecovery method are not triggered in time in most cases. Consequently,after being lost, the retransmitted packet is not detected and recoveredin time, and eventually, timeout retransmission occurs. Specifically, inan existing fast retransmission solution, it is determined, mainlyaccording to an ACK packet received after a packet is retransmitted,whether the retransmitted packet is lost, to perform retransmission, soas to avoid entering timeout retransmission. However, if no packet issent after the packet is retransmitted, the existing retransmissionpacket loss detection and recovery method may not be triggered.Eventually, timeout retransmission inevitably occurs. In this way, theprobability of packet retransmission due to timeout is relatively large,causing a decrease in the throughput.

To resolve the foregoing problems, an embodiment of the presentinvention provides a packet transmission method. After a packet isretransmitted, if it is detected that the retransmitted packet is lost,the lost packet is continuously sent for multiple times (including butnot limited to twice), or a new packet is immediately sent after thelost packet is retransmitted. In this way, on one hand, it is avoidedthat a packet loss detection and recovery algorithm of the retransmittedpacket is not triggered due to insufficient ACK packets. Therefore, theretransmitted packet can be detected and recovered in time after beinglost, and a quantity of times of timeout retransmission is reduced. Onthe other hand, the lost packet is continuously retransmitted formultiple times, and timeout retransmission is triggered only when allretransmitted packets are lost. An actual effect is that a probabilityof a packet loss of the retransmitted packet is exponentially reduced,thereby further reducing the quantity of times of timeoutretransmission, and improving a data transmission rate. As shown in FIG.5, the packet transmission method provided in this embodiment of thepresent invention includes the following steps.

Step 501: A sending node transmits multiple packets (packets 1 to 8shown in FIG. 5) to a receiving node by using a communications linkbetween the sending node and the receiving node, and receives anacknowledgement packet from the receiving node, as shown by arrows fromthe receiving node to the sending node in FIG. 5. A packet sent by thesending node is a TCP packet. A sequence number field (generally seq forshort) of a header of each packet carries a sequence number of the firstdata byte in a payload of the packet. Each time the receiving nodereceives a packet, the receiving node returns an acknowledgement packet(ACK) to the sending node, to indicate that the receiving node hascorrectly received the packet. Optionally, after step 501, the sendingnode may further record a largest sequence number of sent packets, forsubsequent packet loss detection.

Step 503: After determining that a first packet is lost, the sendingnode immediately retransmits the lost first packet, where theretransmitted first packet (that is, FR 3) is also referred to as aretransmitted packet.

Generally, some packets in the multiple packets sent by the sending nodecannot arrive at the receiving node due to a reason such as a networkstatus, and therefore, are lost. The sending node may determine,according to the acknowledgement packet returned by the receiving node,whether a packet is lost. For example, the sending node determines,based on the received acknowledgement packet, that the first packet (forexample, packet 3 shown in FIG. 5) in the multiple packets is lost.

Specifically, the sending node may determine, in multiple manners, thatthe first packet is lost. Using the fast retransmission mechanism shownin FIG. 4 as an example, if the sending node receives at least N(generally, N is equal to 3) acknowledgement packets whose ack valuesare the same, the sending node determines that the first packet whosesequence number is the same ack value plus 1 is lost. As shown in FIG.5, if the sending node receives three acknowledgement packets whose ackfield values are 2, the sending node determines that a packet whosesequence number is 3 is lost. For another example, in anotherembodiment, a SACK field is extended in the acknowledgement packet, andis used to indicate packet information of a receiving buffer, where thereceiving buffer is used to temporarily store a received packet, and avalue of the SACK field is defined as sack. For example, the sack may bea sequence number of a packet received by the receiving node. In thisway, the sending node may learn, according to the sack of theacknowledgement packet returned by the receiving node, packets that arereceived by the receiving node, and packets that are not received by thereceiving node, to further determine whether there is a lost packet.

Optionally, in step 503, the sending node may retransmit the lost firstpacket after a timeout timer of the first packet expires.

Step 505: After detecting that the retransmitted first packet is lost,the sending node immediately continuously sends the first packet fortwice or more than twice. “Immediately” described in this embodiment ofthe present invention refers to within a preset time interval. That is,in step 505, the sending node continuously sends the lost first packetfor twice or more than twice in the preset time interval after thesending node detects that the retransmitted packet is lost. The presettime interval herein should be greater than or equal to 0, and be lessthan or even much less than a period of the timeout timer of the firstpacket. For example, if the period of the timeout timer corresponding tothe first packet is T, the preset time interval should be less than T,or less than T/2, or even less than T/4. Preferably, the preset timeinterval uses a moment at which the sending node detects that theretransmitted first packet is lost as a start point, and the preset timeinterval is equal to 0 or approaches 0. If the preset time interval isequal to 0, it indicates that an action of detecting that theretransmitted packet is lost and an action of sending the first packetare completed simultaneously or almost simultaneously. In addition, aninterval (referred to as the first time interval hereinafter) ofcontinuously sending the first packet for twice, that is, t in FIG. 5,should also be greater than or equal to 0, and be less than or even muchless than the period of the timeout timer of the first packet. Moreover,the sending node has not received, in the first time interval (t), anacknowledgement packet used to indicate that the first packetretransmitted again is lost. That is, when the sending node has notreceived the acknowledgement packet used to indicate that the firstpacket retransmitted again is lost (cannot determine whether the firstpacket retransmitted again is lost), the sending node redundantly sendsthe first packet in the first time interval (t).

It should be noted that the timeout timer is used for TCP timeoutretransmission, that is, when or after sending a packet, the sendingnode enables a timeout timer. A timing period of the timeout timer is T.If an acknowledgement packet corresponding to the packet is still notreceived when one timing period of the timeout timer ends, the sendingnode determines that the packet is lost, and performs timeoutretransmission. Generally, a protocol stack sets a same timeout timerperiod for each packet, that is, each packet has a same timeout timerperiod. Specifically, in an embodiment, step 505 includes:

STEP1: The sending node determines, according to the acknowledgementpacket received after the first packet is retransmitted, that theretransmitted first packet (that is, the retransmitted first packet FR3in step 503) is lost. For example, a largest sequence number ofcurrently sent packets that is recorded by the sending node is 8. Whenthe sending node receives an acknowledgement packet whose sack isgreater than 8, for example, receives an acknowledgement packet whosesack is 9, the sending node may determine that the retransmitted packetis lost. Sack is carried in an extension field (SACK) of theacknowledgement packet, and is used to indicate a sequence number of apacket received by the receiving node. It may be understood that thesending node may further detect, in another manner, whether theretransmitted packet is lost.

STEP2: Immediately retransmit the first packet again. “Immediately”herein refers to within a preset time interval after the sending nodedetermines that the retransmitted packet is lost. The preset timeinterval uses a moment at which the sending node detects that theretransmitted first packet is lost as a start point. The preset timeinterval should be greater than or equal to 0, and be less than or evenmuch less than the period of the timeout timer of the first packet.Preferably, the preset time interval is equal to 0 or approaches 0. Ifthe preset time interval is equal to 0, it indicates that an action ofdetecting, by the sending node, that the retransmitted packet is lostand an action of retransmitting the first packet again are completedsimultaneously or almost simultaneously.

STEP3: After retransmitting the first packet again, the sending nodesends the first packet in the first time interval (t) for at least once.The first time interval (t) herein should be greater than or equal to 0,and be less than or even much less than the period of the timeout timerof the first packet. For example, if a timing period of a timeout timerof the sending node is T, t≤T, or t≤T/2, or t≤T/4. Preferably, the firsttime interval uses a moment of retransmitting the first packet again asa start point. If the first time interval is equal to 0, it indicatesthat actions of sending the first packet in STEP2 and STEP3 arecompleted simultaneously or almost simultaneously. In addition, thesending node has not received, in the first time interval, theacknowledgement packet used to indicate that the first packetretransmitted again is lost. That is, when the sending node has notreceived the acknowledgement packet used to indicate that the firstpacket retransmitted again is lost (cannot determine whether the firstpacket retransmitted again is lost), the sending node redundantly sendsthe first packet.

Further, in an embodiment, an action of retransmitting the first packetin STEP2 and an action of sending the first packet in STEP3 arecontinuous, and the sending node has not sent another packet in the timeinterval t between the action of retransmitting the first packet inSTEP2 and the action of sending the first packet in STEP3. For example,if a sequence number of the first packet retransmitted in STEP2 is N, asequence number of the packet sent in STEP3 is N+1.

Optionally, after step 505, the method further includes:

Step 507: The sending node continues to send a subsequent packet.

Specifically, step 507 includes:

if a packet is currently allowed to be sent, further sending, by thesending node, at least one new packet. The new packet refers to a packetthat is not sent by the sending node before. In an embodiment, thesending node may determine, according to a current sending buffer and/ora congestion control policy, whether the new packet is allowed to besent. For example, if the sending buffer is not empty in the first timeinterval, the sending node sends at least one packet to the sendingbuffer in the first time interval.

In the embodiment described above, after detecting that a retransmittedpacket is lost, a sending node repeatedly sends a first packet in a verytime interval for twice or more than twice. In this way, the sendingnode may continuously receive acknowledgement packets, so that theretransmitted packet can be detected and recovered in time after beinglost, thereby reducing a quantity of times of timeout retransmission,reducing a transmission delay, and improving a transmission rate. Inaddition, if the retransmitted packet is lost again, timeoutretransmission may be triggered. However, if the retransmitted packet isfast retransmitted for multiple times in a short time, a probabilitythat the retransmitted packet is lost is exponentially reduced, therebyfurther reducing a probability of timeout retransmission.

Based on the foregoing embodiment, the present invention furtherprovides another packet transmission method. As shown in FIG. 6, themethod includes the following steps.

Step 601: A sending node transmits multiple packets (for example,packets 1 to 8 in FIG. 6) to a receiving node by using a communicationslink between the sending node and the receiving node. The packets areTCP packets. A sequence number field (Sequence Number, generally seq forshort) of a header of each packet carries a sequence number of the firstdata byte in a payload of the packet. Optionally, after step 601, thesending node may further record a largest sequence number of the sentpackets for subsequent packet loss detection.

Step 603: After determining that a first packet (for example, a packet 3in FIG. 6) is lost, the sending node immediately retransmits the lostfirst packet, where the retransmitted first packet (that is, FR 3) isalso referred to as a retransmitted packet.

Specifically, in step 603, the sending node receives an acknowledgementpacket from the receiving node, and determines, based on the receivedacknowledgement packet, that the first packet (for example, a packet 3in FIG. 6) in the multiple packets is lost. For a specific method ofdetermining, by the sending node according to the acknowledgementpacket, that the first packet is lost, refer to related descriptions ofstep 503. In another embodiment of the present invention, the firstpacket may be retransmitted for once or for multiple times after atimeout timer exceeds a preset time interval. “Immediately” in step 603refers to within a preset time interval after it is determined that thefirst packet is lost. The preset time interval is greater than or equalto 0, and is less than or even much less than a period of the timeouttimer of the first packet. Preferably, the preset time interval uses amoment of detecting that the retransmitted first packet is lost as astart point, and the preset time interval is equal to 0 or approaches 0.

Step 605: The sending node determines, according to an acknowledgementpacket received after the first packet is retransmitted, that theretransmitted packet (that is, the retransmitted first packet FR3 instep 602) is lost, and immediately retransmits the first packet again.For a specific method of determining, by the sending node, that theretransmitted packet is lost, refer to related descriptions of STEP1 inFIG. 5. Moreover, a related meaning and explanation of “immediately” instep 605 are similar to those described in step 505, and details are notdescribed herein again.

Step 607: The sending node determines whether a sending buffer is empty,and if the sending buffer is empty, the sending node sends the firstpacket for at least once in the first time interval after retransmittingthe first packet again. For a definition of the first time interval,refer to the embodiment shown in FIG. 5. Further, in another embodiment,the first time interval in step 607 may use a moment of retransmittingthe first packet again as a start point, and use a moment of receivingthe first acknowledgement packet after the first packet is retransmittedagain as an end point. In this way, after retransmitting the firstpacket again, the sending node actually sends the first packet againbefore receiving the acknowledgement packet used to indicate that thefirst packet retransmitted again is lost.

It should be noted that the sending buffer in step 607 is configured tobuffer to-be-sent data of an application, that is, data that is not sentby the sending node. A packet in the sending buffer is inserted into asending queue at a particular time, and is sent from the sending queue.The sending queue may include a packet that is not sent by the sendingnode, and a retransmitted packet may also be inserted into the sendingqueue.

Further, as shown in FIG. 6, in an embodiment, step 607 furtherincludes: if the sending buffer is not empty, sending, by the sendingnode, a second packet (for example, packet 11 in FIG. 6) in the sendingbuffer in the first time interval (tin FIG. 6) after retransmitting thefirst packet again. It may be understood that the second packet is a newpacket, that is, a packet that is not sent before the sending noderetransmits the first packet again.

In another embodiment, the foregoing steps 605 and 607 are completed ina preset time interval, that is, actions of retransmitting the firstpacket again, determining whether the sending buffer is empty, andredundantly sending the first packet or sending the second packet arecompleted in the preset time interval. The preset time interval isgreater than or equal to 0, and is less than or even much less than theperiod of the timeout timer of the first packet. In addition, thesending node has not received, in the preset time interval, anacknowledgement packet used to indicate that the first packetretransmitted again is lost. That is, when the sending node has notreceived the acknowledgement packet used to indicate that the firstpacket retransmitted again is lost (cannot determine whether the firstpacket retransmitted again is lost), the sending node redundantly sendsthe first packet.

Further, in an embodiment, the sending node may collect statusinformation in a process of transmitting a packet to the receiving node.Therefore, after retransmitting the first packet, the sending node cancalculate, according to the collected status information, whether thesending node can immediately send a new packet after retransmitting thefirst packet. The status information includes but is not limited to atleast one piece of the following information: a size of the sendingbuffer of the sending node, a size of a congestion window of the sendingnode, a congestion control policy of the sending node, or a size of areceive window of the receiving node. Correspondingly, in step 607, ifthe sending buffer of the sending node is not empty, and the congestioncontrol policy of the sending node allows sending of a new packet, thesending node determines that the new packet is currently allowed to besent, and further sends the new packet in the first time interval afterretransmitting the first packet again. Alternatively, if the sendingbuffer of the sending node is not empty, and the congestion controlpolicy of the sending node does not allow sending of a new packet, thesending node still determines that the new packet may be currentlyallowed to be sent, and sends the new packet in the first time interval(t) after retransmitting the first packet again. That is, in step 607,the sending node determines, merely according to the sending buffer,whether to send the new packet in the first time interval, but ignores alimitation of the congestion control policy. A specific method ofignoring the congestion control policy includes: after the sending noderetransmits the lost packet again, if the sending buffer is not empty,temporarily increasing, by the sending node, the congestion window, toavoid the limitation of the congestion control policy in the first timeinterval, and rapidly send the new packet. Further, after sending thenew packet, the sending node recovers the congestion window.

It should be noted that a difference between the packet transmissionmethod in this embodiment of the present invention and the method shownin FIG. 5 is that in this embodiment of the present invention, thesending node does not repeatedly send the lost first packet in the firsttime interval for twice or more than twice each time after detectingthat the retransmitted packet is lost, but further determines whetherthe new packet can be currently sent, and if yes, sends at least one newpacket in the first time interval. Compared with the method shown inFIG. 5, by using the method in this embodiment of the present invention,when a probability of loss of a retransmitted packet is reduced,redundant sending of a packet is reduced, and the network transmissionefficiency is improved.

Based on the method shown in FIG. 6, an embodiment of the presentinvention further provides another packet transmission method. As shownin FIG. 7, the method includes the following steps.

Step 701: A sending node transmits multiple packets (for example,packets 1 to 8 in FIG. 7) to a receiving node by using a communicationslink between the sending node and the receiving node.

Step 703: After determining that a first packet (for example, a packet 3in FIG. 7) is lost, the sending node immediately retransmits the lostfirst packet, where the retransmitted first packet (that is, FR 3) isalso referred to as a retransmitted packet. “Immediately” herein refersto within a time interval approaching 0. For details, refer to therelated descriptions in the embodiments shown in FIG. 5 and FIG. 6.

Step 705: The sending node determines, according to an acknowledgementpacket received after the first packet is retransmitted, that theretransmitted packet (that is, the retransmitted first packet FR3 instep 602) is lost, and immediately retransmits the first packet again.For a specific method of determining, by the sending node, that theretransmitted packet is lost, refer to related descriptions of STEP1 inFIG. 5. In addition, a related meaning and explanation of “immediately”in step 705 are similar to those described in step 505 and step 605, anddetails are not described herein again.

Step 707: Determine whether a sending buffer is empty, and whether acongestion control policy allows sending of a new packet; if the sendingbuffer is empty, or the current congestion control policy does not allowsending of the new packet, the sending node sends the first packet in afirst time interval (for example, t in FIG. 7) for at least once;otherwise, if the sending buffer is not empty, and the currentcongestion control policy allows sending of the new packet, the sendingnode sends at least one new packet in the first time interval. For adefinition of the first time interval, refer to the method embodimentshown in FIG. 5, and details are not described again.

Further, as shown in FIG. 7, after step 707, the packet transmissionmethod further includes:

Step 709: The sending node determines whether the sending buffer isempty, and if the sending buffer is empty, returns or waits; or if thesending buffer is not empty, determines whether the current congestioncontrol policy allows sending of the new packet, and if the currentcongestion control policy does not allow sending of the new packet,returns or waits; or if the current congestion control policy allowssending of the new packet, sends the new packet.

Compared with the method shown in FIG. 6, in the method shown in FIG. 7,both the sending buffer and the congestion control policy are consideredwhen it is determined whether to send the new packet, and the congestioncontrol policy is conformed to because the new packet is not sent.

Another packet transmission method in an embodiment of the presentinvention is described below based on a specific application scenario (anetwork video surveillance scenario). As shown in FIG. 8, it is assumedthat a user watches, by using user equipment, a video taken by a remotenetwork camera. A chip of the network camera integrates a light TCP/IPprotocol stack. The protocol stack implements the packet transmissionmethod in this embodiment of the present patent invention. It is assumedthat a packet loss rate of a link is 5%. In a TCP packet transmissionprocess, it is assumed that a packet 3 whose sequence number is 3 islost. The packet transmission method in this embodiment of the presentinvention is shown in FIG. 9.

Step 1001: After detecting that the packet 3 is lost, the network cameraretransmits the packet 3, and records that a largest sequence number ofcurrently sent packets is 8.

Step 1002: When a sending buffer is not empty, and a congestion controlpolicy allows sending of a new packet, a sending node continues to senda new packet.

Step 1003: When the third repeated ACK after the packet 3 isretransmitted is received, a sequence number of a cumulativeacknowledgment is still 2 and is not updated, and a packet whosesequence number is 9 has been acknowledged, the network cameradetermines that the retransmitted packet is lost.

Step 1004: Immediately retransmit the packet 3 again, and record that alargest sequence number of currently sent packets is 10.

Step 1005: Determine, according to the sending buffer and the congestioncontrol policy, whether to continue to send a new packet currently.

Step 1006: If the sending buffer is not empty, but the currentcongestion control policy does not allow sending of the new packet,immediately send at least one new packet; or if the sending buffer isempty, immediately send the packet 3 for at least once. “Immediately”described in this embodiment of the present invention refers to within apreset time interval. That is, the sending node redundantly sends thelost packet 3 for at least once or a new packet in a preset timeinterval after retransmitting the packet 3 again. The preset timeinterval herein should be greater than or equal to 0, and less than oreven much less than a period of a timeout timer of the packet 3. Forexample, if the period of the timeout timer corresponding to the packet3 is T, the preset time interval should be less than T, or less thanT/2, or even less than T/4. Preferably, the preset time interval uses amoment of retransmitting the packet 3 again as a start point, and thenetwork camera detects that an acknowledgement packet used to indicatethat the packet 3 retransmitted again is lost has not been received inthe preset time interval.

In the method in this embodiment of the present invention, afterdetecting that a packet is lost, the network camera retransmits thepacket, and determines whether a new packet can be currently sent. Ifthe new packet cannot be sent, the sending node redundantly sends thelost packet in a preset time interval. In this way, a probability of apacket loss can be reduced, and the data transmission efficiency can beimproved.

Experimental results of this embodiment of the present invention thatare obtained in different network environments of different packet lossrates are shown in Table 1 and Table 2. According to Table 1, in ascenario of transmitting 200 MB data, by using the packet transmissionmethod in this embodiment of the present invention, a quantity of timesof packet losses is 2 to 5 times less than that obtained by using a DACmethod. As shown in Table 2, when the method of the present invention isused, a throughput is at least two times higher than a throughputobtained by using the DAC method. In a high packet loss rate scenario,the throughput exceeds that of a native protocol stack of Linux.

TABLE 1 Quantities of times of packet losses when 200 MB data istransmitted in scenarios of different packet loss rates Packet loss rate1% 3% 5% 7% 9% 11% DAC 0 9 52 134 291 534 Optimization 0 0 8 31 84 169

TABLE 2 Throughputs when 200 MB data is transmitted in scenarios ofdifferent packet loss rates Packet loss rate 1% 3% 5% 7% 9% 11% DAC11.31 MiB/s 5.81 MiB/s 1.99 MiB/s 0.83 MiB/s 0.36 MiB/s 0.19 MiB/sOptimization 11.33 MiB/s 11 MiB/s 6.8 MiB/s 2.87 MiB/s 1.29 MiB/s 0.65MiB/s Linux 11.24 MiB/s 8.7 MiB/s 4.54 MiB/s 1.96 MiB/s 0.89 MiB/s 0.53MiB/s

The method embodiments described in FIG. 5 to FIG. 7 are packet sendingmechanisms after it is detected that a retransmitted packet is lost. Itmay be understood that in an optional embodiment of the presentinvention, after it is detected, for the first time, that a packet (forexample, a first packet) is lost, the first packet may be continuouslyretransmitted in a first time interval for multiple times. In anotherembodiment, after the sending node detects, for the first time, that thefirst packet is lost, if a current sending buffer is not empty, thesending node continuously sends the first packet and at least one newpacket in the first time interval; otherwise, the sending nodecontinuously sends the first packet in the first time interval for atleast twice. In another embodiment, after the sending node detects, forthe first time, that the first packet is lost, if the current sendingbuffer is empty, or a current congestion control policy does not allowsending of a new packet, the sending node continuously sends the firstpacket in the first time interval for at least once; otherwise,continuously sends the first packet and at least one new packet.

As can be seen, the redundant packet-sending mechanism described in FIG.5 to FIG. 7 of the present invention is not limited to being triggeredafter it is detected that a retransmitted packet is lost. In addition, apacket may be sent redundantly the first time when it is detected thatthe packet is lost.

Based on the foregoing method embodiments, the present invention furtherprovides user equipment, to implement functions of the sending node inthe foregoing method embodiments. Specifically, referring to FIG. 2, theuser equipment 110 includes: the processor 120, the TCP protocol stack130, the antenna 142, the wireless modem 140, and the memory 150. Thewireless modem 140 is connected to the antenna 142. The TCP protocolstack 130 is configured to: encapsulate, under the control of theprocessor 120, data of an application program into multiple packets of aparticular data format according to a TCP/IP protocol specification, andsend the multiple packets to the wireless modem 140. The wireless modem140 is configured to: modulate the received packets to analog signals,and transmit the analog signals by using the antenna. The applicationprogram server 20 may receive, by using a wireless network, the analogsignals transmitted by the user equipment 110, demodulate the analogsignals to digital signals, and send the digital signals to a TCPprotocol stack 21 of the application program server 20. The TCP protocolstack 21 is configured to decapsulate the digital signals, to finallyobtain the data of the application program. TCP protocol stacks of theuser equipment 110 and the application program server 20 include: aphysical layer, a link layer, a network layer, a transmission layer, andan application layer. A process in which a TCP protocol stackencapsulates and decapsulates a packet is shown in FIG. 10. As can beseen, an encapsulation process of the packet is actually a process ofadding, by the TCP protocol stack, a header and/or a frame trailer tothe packet, and a decapsulation process of the packet is actually aprocess of removing the header and/or the frame trailer from the packet.

Further, after receiving a packet sent by the user equipment 110, theapplication program server 20 returns an acknowledgement packet, toindicate that the packet have been received. The TCP protocol stack 130is further configured to: determine, under the control of the processor120 and according to the acknowledgement packet received from theapplication program server, that a first packet is lost; andcontinuously retransmit the first packet in a preset time interval forat least twice.

Preferably, in another embodiment, the TCP protocol stack 130 is furtherconfigured to perform some or all steps in FIG. 5, FIG. 6, or FIG. 7under the control of the processor 120.

It should be noted that, the TCP protocol stack 130 may be executed by aproper combination of software, hardware, and/or firmware on the userequipment 110. For example, in an embodiment, the TCP protocol stack 130is stored in the memory 150 in a form of executable program code. Theprocessor 120 executes the program code corresponding to the TCPprotocol stack 130, to perform some or all steps described in FIG. 5,FIG. 6, or FIG. 7. Specifically, as shown in FIG. 12, the user equipment100 is divided, according to a logical hierarchy, into: a chip/hardwareplatform, a kernel on the chip/hardware platform, middleware, and anapplication program running on the middleware. The kernel, themiddleware, and the application program are all stored in the memory 150of the user equipment 110 in a manner of executable code. The processorparses the code into specific instructions and executes theinstructions, to complete a corresponding function. An execution chipincludes at least one of a general purpose processor, a microprocessor,a graphics processing unit, or a baseband processor. The hardwareplatform includes: a chip, a memory, a communications interface, and thelike. The kernel specifically includes: a chip driver, a peripheraldriver (for example, a communications interface and a sensor driver), ahardware adaption layer, and a basic kernel. The basic kernel providesfunctions such as memory management, interrupt management, processmanagement, and a file system. The processor runs executable codecorresponding to the kernel, to schedule a hardware resource toimplement a particular function, for example, reading and writing dataand generating a control instruction.

Further, the middleware, as a joint point between the kernel and anupper-layer application program, may include multiple types of protocolstacks, so that the user equipment supports different types ofprotocols. For example, the middleware may include the TCP protocolstack described in the foregoing embodiment. The middleware furtherincludes an application programming interface (API) and different typesof service components. The service components are developed for aparticular application or service, and provide some extension functionsfor the application or the service. For an application scenario shown inFIG. 8, the service components may include a video component, configuredto provide a video optimization function and/or a video coding anddecoding function, so as to support an operation of a video surveillanceapplication. The API is configured for interworking between theupper-layer application program, the middleware, and the kernel, totransfer a message. Optionally, the middleware further includes asecurity component, configured to implement authentication andauthorization of a device.

Specifically, in a process in which an application program (for example,APP 1) is executed by the processor, the API may be invoked to transfera data packet to a network protocol stack (for example, a TCP protocolstack). After sensing the packet, the TCP protocol stack invokes thehardware driver in the kernel by using a system function, to driverelated hardware, for example, the wireless modem 140 and the antenna142, to send, receive, and process the packet. In addition, a datapacket loss detection and packet retransmission are also implemented bythe processor by running the TCP protocol stack. For specificimplementation details of packet loss detection and packet transmissionby the TCP protocol stack, refer to the foregoing embodiments, anddetails are not described herein again.

In another embodiment, the TCP protocol stack 130 may be implemented bya hardware circuit or a dedicated chip such as a field programmable gatearray (FPGA) or an application-specific integrated circuit (ASIC). Inthis case, the processor 120 and the TCP hardware circuit or theapplication-specific chip that is configured to implement the TCPprotocol stack are connected by using a bus. The processor runs theapplication program in the memory 150, and invokes the TCP hardwarecircuit or the dedicated chip configured to implement the TCP protocolstack, so as to transmit and process data generated in a process ofrunning the application program. Specifically, the processor 120 decodescode corresponding to the application program into machine instructions,executes the machine instructions one by one, and in a process ofexecuting the instructions, invokes, by using a corresponding program,the TCP hardware circuit or the dedicated chip to send and receive apacket. Correspondingly, under invocation of the processor 120, the TCPhardware circuit or the dedicated chip cooperates with another piece ofhardware to complete the steps or functions described in the methodembodiments of the present invention. In addition, for related detailsof executing the foregoing method steps by the TCP hardware circuit orthe application-specific chip of the TCP protocol stack, refer to theforegoing method embodiments, and details are not described hereinagain.

As shown in FIG. 11, an embodiment of the present invention furtherprovides another user equipment 300, including: a processing circuit302, and a communications interface 304 and a storage medium 320 thatare connected to the processing circuit 302.

The processing circuit 302 is configured to: process and/or send data,control data access and storage, give a command, and control anotherdevice to perform an operation. The processing circuit 302 may beimplemented as one or more processors, one or more controllers, and/oranother structure that may be configured to execute a program and thelike. The processing circuit 302 may specifically include: a generalpurpose processor, a digital signal processor (DSP), anapplication-specific integrated circuit (ASIC), a field programmablegate array (FPGA), or another programmable logical component. Thegeneral purpose processor may include: a microprocessor, and any normalprocessor, controller, microcontroller, or state machine. The processingcircuit 302 may be implemented as a computing component, for example, acombination of the DSP and the microprocessor.

The storage medium 306 may include a computer readable storage mediumsuch as a magnetic storage device (for example, a hard disk, a floppydisk, or a magnetic stripe), an optical storage medium (for example, adigital versatile disc (DVD)), a smartcard, a flash memory device, arandom access memory (RAM), a read-only memory (ROM), a programmable ROM(PROM), an erasable PROM (EPROM), a register, or any combinationthereof. The storage medium 306 may be coupled to the processing circuit302, so that the processing circuit 302 can read information and writeinformation to the storage medium 306. Specifically, the storage medium306 may be integrated into the processing circuit 302, or the storagemedium 306 and the processing circuit 302 may be separated.

The processing circuit 302 is adapted to execute a program stored in thestorage medium 306. The term “program” used in this embodiment of thepresent invention should be widely understood as, including but notlimited to: an instruction, an instruction set, code, a code segment, asubroutine, a software module, an application, a software package, athread, a process, a function, firmware, middleware, and the like.

The communications interface 304 may include a circuit and/or a programto implement bidirectional communication between the user equipment 300and one or more wireless network devices (for example, a network node).The communications interface 304 may be coupled to one or more antennas(not shown in FIG. 11), and include at least one receiver circuit 316and/or at least one transmitter circuit 318. In an embodiment, thecommunications interface 304 may be implemented by a wireless modementirely or partly.

In an embodiment, the storage medium 306 stores a protocol stackprotocol 320. The processing circuit 302 executes the protocol stackprotocol 320 to implement a function of the protocol stack module 308.The protocol stack module 308 may perform decoding and/or decapsulationprocessing on data received by the communications interface 304, andtransfer the data to the upper-layer application program, or may performencapsulation processing on data of the application program, and thensend the data to another device by using the communications interface.For a specific working process of the protocol stack module 308, referto the TCP protocol stacks 130 and 21 in the foregoing embodiment andrelated descriptions in FIG. 11.

In an embodiment, the protocol stack module 308 may include: a physicallayer module, a data link layer module, a network layer module, atransmission layer module, and an application layer module, to implementprotocols of layers. For example, the physical layer module may includea circuit and/or a program, configured to: define a physical deviceinterface feature, a transmission medium type, a transmission rate, atransmission mode, and the like, and implement signal processing of aphysical layer. Similarly, the data link layer module may include acircuit and/or a program, configured to implement a function of a datalink layer, for example, responsible for delivering signaling generatedby a network layer and processing information generated by the physicallayer. The data link layer module may include one or more submodules,for example, a media access control (MAC) layer module, a radio linkcontrol (RLC) layer module, and a logical link control (LLC) layermodule that are respectively configured to implement functions of a MAClayer, an RLC layer, and an LLC layer. For example, the MAC layer moduleis configured to: transmit upper-layer protocol data by using a serviceprovided by the physical layer, and manage data access between an upperlayer and an air interface. The RLC layer module is configured for datasegmentation and reassembly. The LLC layer module is configured toprovide a traffic and sequence control function and an error controlfunction. Further, the network layer module may include a circuit and/ora program, to implement a function of a network layer, for example,logical addressing and routing. The transmission layer module mayinclude a circuit and/or a program, configured to implement a functionof a transmission layer, for example, port addressing, segmentation andreassembly, connection control, traffic control, and error control. Theapplication layer module may include a circuit and/or a program,configured to provide an interface to an upper-layer applicationprogram.

According to one or more aspects of this embodiment of the presentinvention, the processing circuit 302 is adapted to execute the protocolstack protocol 320 stored in the storage medium 306, so as to implementa function of the protocol stack module 308. The protocol stack module308 specifically implements some or all steps in the foregoing methodembodiments.

As shown in FIG. 13, an embodiment of the present invention furtherprovides user equipment 13, to implement functions of the sending nodein the foregoing method embodiments. The user equipment 13 includes: areceiving unit 131, a sending unit 133, and a processing unit 132.

The sending unit 133 is configured to send multiple packets to areceiving node 14 in communication connection with the user equipment13.

The receiving unit 131 is configured to receive acknowledgement packetsfrom the receiving node 14.

In an embodiment, the processing unit 132 is configured to: determine,according to the acknowledgement packets received by the receiving unit131, that a first packet in the multiple packets is lost; and triggerthe sending unit 133 to retransmit the first packet to the receivingnode 14. Further, the processing unit 132 is further configured to:determine, according to an acknowledgement packet received by thereceiving unit 131 after the first packet is retransmitted, that theretransmitted packet is lost, and immediately trigger the sending unit133 to continuously send the first packet in a first time interval forat least twice, where the retransmitted packet is the retransmittedfirst packet. For detailed definitions of “immediately” and the “firsttime interval”, refer to the foregoing method embodiments.

In another embodiment, the processing unit 132 is configured to:determine, according to the acknowledgement packets received by thereceiving unit 131, that the first packet in the multiple packets islost; and trigger the sending unit 133 to retransmit the first packet tothe receiving node 14. Further, the processing unit 132 is furtherconfigured to: determine, according to the acknowledgement packetreceived by the receiving unit 131 after the first packet isretransmitted, that the retransmitted packet is lost, trigger thesending unit 133 to retransmit the first packet again, and determinewhether a sending buffer is empty; and if the sending buffer is notempty, send at least one packet in the sending buffer in the first timeinterval, where the packet in the sending buffer is a packet that is notsent by the sending unit. Further, the processing unit 132 is furtherconfigured to: if the sending buffer is empty, trigger the sending unit133 to send the first packet in the first time interval for at leastonce. For the detailed definition of the “first time interval”, refer tothe foregoing method embodiments.

In another embodiment, the processing unit 132 is configured to:determine, according to the acknowledgement packets received by thereceiving unit 131, that the first packet in the multiple packets islost; and trigger the sending unit 133 to retransmit the first packet tothe receiving node 14. Further, the processing unit 132 is furtherconfigured to: determine, according to the acknowledgement packetreceived by the receiving unit 131 after the first packet isretransmitted, that the retransmitted packet is lost, trigger thesending unit 133 to retransmit the first packet again, and determinewhether the sending buffer is empty, or whether a current congestioncontrol policy allows sending of a new packet; and if the sending bufferis empty, or the current congestion control policy does not allowsending of the new packet, send the first packet in the first timeinterval for at least once. Further, the processing unit 132 is furtherconfigured to: if the sending buffer is not empty, and the currentcongestion control policy allows sending of the new packet, send atleast one packet in the sending buffer in the first time interval, wherethe packet in the sending buffer is a packet that is not sent by thesending unit. For the detailed definition of the “first time interval”,refer to the foregoing method embodiments.

It should be noted that for detailed working processes of the receivingunit 131, the sending unit 133, and the processing unit 132, refer tothe foregoing method embodiments, and details are not described hereinagain.

An embodiment of the present invention further provides user equipment,including: a sending unit, a receiving unit, and a processing unit.

The sending unit is configured to send multiple packets to a receivingnode in communication connection with the user equipment.

The receiving unit is configured to receive multiple acknowledgementpackets from the receiving node.

In an embodiment, the processing unit is configured to: determine,according to the multiple acknowledgement packets received by thereceiving unit, that a first packet in the multiple packets is lost,trigger the sending unit to immediately retransmit the first packet tothe receiving node, and send the first packet in a second time intervalfor at least once, where the second time interval is greater than orequal to 0, and is less than a period of a timeout timer of the firstpacket, and a sending node has not received, in the second timeinterval, an acknowledgement packet used to indicate that theretransmitted first packet is lost. In addition, “immediately” describedherein refers to within a preset time interval after it is determinedthat the first packet is lost. The preset time interval is greater thanor equal to 0, and is less than or even much less than the period of thetimeout timer of the first packet. Preferably, the preset time intervalis equal to 0 or approaches 0.

In another embodiment, the processing unit is configured to: determine,according to the multiple acknowledgement packets received by thereceiving unit, that the first packet in the multiple packets is lost;and trigger the sending unit to immediately retransmit the first packetto the receiving node. Further, the processing unit is furtherconfigured to: determine whether a sending buffer is empty, and if thesending buffer is empty, trigger the sending unit to send the firstpacket in the second time interval for at least once. Further, theprocessing unit is further configured to: if the sending buffer is notempty, trigger the sending unit to send at least one packet in thesending buffer in the first time interval, where the packet in thesending buffer is a packet that is not sent by the sending unit. Thesecond time interval is greater than or equal to 0, and is less than theperiod of the timeout timer of the first packet, and the sending nodehas not received, in the second time interval, the acknowledgementpacket used to indicate that the retransmitted first packet is lost. Inaddition, “immediately” described herein refers to within a preset timeinterval after it is determined that the first packet is lost. Thepreset time interval is greater than or equal to 0, and is less than oreven much less than the period of the timeout timer of the first packet.Preferably, the preset time interval is equal to 0 or approaches 0.

In another embodiment, the processing unit is configured to: determine,according to the multiple acknowledgement packets received by thereceiving unit, that the first packet in the multiple packets is lost;and trigger the sending unit to immediately retransmit the first packetto the receiving node. Further, the processing unit is furtherconfigured to: determine whether the sending buffer is empty, or whethera current congestion control policy allows sending of a new packet; andif the sending buffer is empty, or the current congestion control policydoes not allow sending of the new packet, trigger the sending unit tosend the first packet in the second time interval for at least once.Further, the processing unit is further configured to: if the sendingbuffer is not empty, and the current congestion control policy allowssending of the new packet, trigger the sending unit to send at least onepacket in the sending buffer in the second time interval, where thepacket in the sending buffer is a packet that is not sent by the sendingunit. The second time interval is greater than or equal to 0, and isless than the period of the timeout timer of the first packet, and thesending node has not received, in the second time interval, theacknowledgement packet used to indicate that the retransmitted firstpacket is lost. In addition, “immediately” described herein refers towithin a preset time interval after it is determined that the firstpacket is lost. The preset time interval is greater than or equal to 0,and is less than or even much less than the period of the timeout timerof the first packet. Preferably, the preset time interval is equal to 0or approaches 0.

A person of ordinary skill in the art may understand that all or some ofthe steps of the methods in the embodiments may be implemented by aprogram instructing relevant hardware (such as a processor). The programmay be stored in a computer readable storage medium. The storage mediummay include: a ROM, a RAM, a magnetic disk, or an optical disc.

The packet transmission method and the user equipment that are providedin the embodiments of the present invention are described in detailabove. In this specification, specific examples are used to describe theprinciple and implementation manners of the present invention, and thedescriptions of the embodiments are only intended to help understand themethod and core idea of the present invention. In addition, a person ofordinary skill in the art may, based on the idea of the presentinvention, make modifications with respect to the specificimplementation manners and the application scope. Therefore, the contentof this specification shall not be construed as a limitation to thepresent invention.

What is claimed is:
 1. A method implemented by a sending node in awireless network for transmitting data to a receiving node, comprising:transmitting multiple packets to the receiving node; upon determinationthat a first packet in the multiple packets is lost, retransmitting, bythe sending node, the first packet for a first time; in response todetermining, by the sending node, based on at least one acknowledgementpacket received from the receiving node after the first packet isretransmitted for the first time, that the first packet retransmittedfor the first time is lost: retransmitting, by the sending node, thefirst packet for a second time; and upon determination that a sendingbuffer of the sending node is empty, immediately sending, by the sendingnode, the first packet for at least once after the first packet isretransmitted for the second time.
 2. The method according to claim 1,further comprising: upon determination that the sending buffer is notempty, immediately sending at least one new packet in the sending bufferafter the first packet is retransmitted for the second time.
 3. Themethod according to claim 1, wherein each of the at least oneacknowledgement packet carries information indicating a sequence numberof a packet that has been acknowledged receipt by the receiving node,and determining that the first packet retransmitted for the first timeis lost comprises: determining, according to the information carried inthe at least one acknowledgement packet, that the first packetretransmitted for the first time is lost.
 4. The method according toclaim 1, wherein a time interval between retransmitting the first packetfor the second time and sending the first packet for at least once isless than a period of a timer set for timeout retransmission.
 5. Themethod according to claim 4, wherein no acknowledgement packet thatindicating the first packet retransmitted for the second time is lost isreceived by the sending node during the time interval.
 6. The methodaccording to claim 2, wherein a time interval between retransmitting thefirst packet for the second time and sending the at least one new packetis less than a period of a timer set for timeout retransmission.
 7. Themethod according to claim 6, wherein no acknowledgement packet thatindicating the first packet retransmitted for the second time is lost isreceived by the sending node during the time interval.
 8. The methodaccording to claim 1, further comprising: establishing, by the sendingnode, a transmission control protocol (TCP) connection with thereceiving node.
 9. The method according to claim 8, wherein the multiplepackets are TCP packets, and transmitting the multiple packets to thereceiving node comprises transmitting the TCP packets to the receivingnode using the TCP connection.
 10. User equipment, comprising: aprocessing circuit, and a communications interface and a storage mediumthat are connected to the processing circuit, wherein the processingcircuit is configured to execute a protocol stack program stored in thestorage medium to: transmit multiple packets to a receiving node usingthe communications interface; upon determination that a first packet inthe multiple packets is lost, retransmit the first packet for a firsttime using the communications interface; in response to determining,based on at least one acknowledgement packet received from the receivingnode after the first packet is retransmitted for the first time, thatthe first packet retransmitted for the first time is lost: retransmitthe first packet for a second time using the communications interface;and upon determination that a sending buffer of the user equipment isempty, immediately send, using the communications interface, the firstpacket for at least once after the first packet is retransmitted for thesecond time.
 11. The user equipment according to claim 10, wherein theprocessing circuit is further configured to: upon determination that thesending buffer is not empty, immediately send, using the communicationsinterface, at least one new packet in the sending buffer after the firstpacket is retransmitted for the second time.
 12. The user equipmentaccording to claim 10, wherein a time interval between retransmittingthe first packet for the second time and sending the first packet for atleast once is less than a period of a timer set for timeoutretransmission.
 13. The user equipment according to claim 12, wherein noacknowledgement packet that indicating the first packet retransmittedfor the second time is lost is received by the user equipment during thetime interval.
 14. The user equipment according to claim 11, wherein atime interval between retransmitting the first packet for the secondtime and sending the at least one new packet is less than a period of atimer set for timeout retransmission.
 15. The user equipment accordingto claim 14, wherein no acknowledgement packet that indicating the firstpacket retransmitted for the second time is lost is received by the userequipment during the time interval.
 16. The user equipment according toclaim 10, wherein the multiple packets are transmission control protocol(TCP) packets, and the processing circuit is further configured to:establish a TCP connection with the receiving node.
 17. A non-transitorycomputer readable storage medium, comprising a program which, whenexecuted by user equipment, causes the user equipment to perform thefollowing operations: transmitting multiple packets to a receiving node;upon determination that a first packet in the multiple packets is lost,retransmitting the first packet for a first time; in response todetermining, based on at least one acknowledgement packet received fromthe receiving node after the first packet is retransmitted for the firsttime, that the first packet retransmitted for the first time is lost:retransmitting the first packet for a second time; and upondetermination that a sending buffer of the user equipment is empty,immediately sending the first packet for at least once after the firstpacket is retransmitted for the second time.
 18. The computer readablestorage medium according to claim 17, wherein the operations furthercomprise: upon determination that the sending buffer is not empty,immediately sending at least one new packet in the sending buffer afterthe first packet is retransmitted for the second time.
 19. The computerreadable storage medium according to claim 17, wherein each of the atleast one acknowledgement packet carries information indicating asequence number of a packet that has been acknowledged receipt by thereceiving node, and determining that the first packet retransmitted forthe first time is lost comprises: determining, according to theinformation carried in the at least one acknowledgement packet, that thefirst packet retransmitted for the first time is lost.
 20. The computerreadable storage medium according to claim 17, wherein a time intervalbetween retransmitting the first packet for the second time and sendingthe first packet for at least once is less than a period of a timer setfor timeout retransmission.